from rest_framework.views import APIView
from rest_framework.response import Response

from .models import AdvertisingCate, Contents
from .serializer import AdvertisingCateModelSerializer, ContentsModelSerializer


class CarouselView(APIView):
    """
    轮播图展示
    """
    def get(self, request):
        carousel_list = Contents.objects.filter(cate_id=1, serial_number='第一期', is_show=1)
        carousel_ser = ContentsModelSerializer(carousel_list, many=True)
        return Response(carousel_ser.data)




